package com.qf.dao.blog.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.api.blog.entity.ArticleCategoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
* @author sin
* @description 针对表【t_article_category(文章所属分类关联表)】的数据库操作Mapper
* @createDate 2025-05-23 13:27:40
* @Entity com.qf.api.entity.TArticleCategory
*/
@Mapper
public interface ArticleCategoryMapper extends BaseMapper<ArticleCategoryEntity> {

    @Select("select category_id from t_article_category where article_id = #{id}")
    Long selectByArticleId(Long id);

    @Select("update t_article_category set category_id = #{categoryId} where article_id = #{articleId}")
    void updateByArticleId(@Param("articleId") Long articleId, @Param("categoryId") Long categoryId);
}




